import { Injectable } from '@angular/core';
import { HttpHeaders, HttpClient } from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class EmailInfoService {
  host = 'http://localhost:8888';

  constructor(private http: HttpClient) {}

  sendEmailInfo(emailInfo) {
    const headers = new HttpHeaders().set('Content-Type', 'application/json');
    return this.http.post<string>(this.host + '/send', emailInfo, { headers, responseType: 'text' as 'json'});
  }
}
